import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const getRoutes = () => {
  return [{
      path: '/login',
      component: () => import('@/views/login'),
      meta: {
        tab: '登陆'
      }
    },
    {
      path: '/',
      component: () => import('@/views/_layout'),
      children: [{
          path: '/',
          component: () => import('@/views/index'),
          meta: {
            tab: '首页'
          }
        },
        {
          path: '/logo/logo',
          component: () => import('@/views/logo/logo'),
          meta: {
            tab: 'logo管理'
          }
        },
        {
          path: '/system/role/role',
          component: () => import('@/views/system/role/role'),
          meta: {
            tab: '权限管理'
          }
        },
        {
          path: '/system/role/accountNumber',
          component: () => import('@/views/system/role/accountNumber'),
          meta: {
            tab: '账号管理'
          }
        },
        {
          path: '/system/advertising/shopManage',
          component: () => import('@/views/system/advertising/shopManage'),
          meta: {
            tab: '门店管理'
          },
        },
        {
          path: '/system/advertising/shopManage',
          component: () => import('@/views/system/advertising/shopManage'),
          meta: {
            tab: '门店管理'
          },
        },
        {
          path: '/system/advertising/shopUserManage',
          component: () => import('@/views/system/advertising/shopUserManage'),
          meta: {
            tab: '门店员工管理'
          }
        },
        {
          path: '/mall/product/index',
          component: () => import('@/views/mall/product/index'),
          meta: {
            tab: '商城-商品列表'
          }
        },
        {
          path: '/mall/product/classify/index',
          component: () => import('@/views/mall/product/classify/index'),
          meta: {
            tab: '商城-商品分类'
          }
        },
        {
          path: '/mall/product/stock/index',
          component: () => import('@/views/mall/product/stock/index'),
          meta: {
            tab: '商城-商品库存'
          }
        },
        {
          path: '/mall/product/appointment',
          component: () => import('@/views/mall/product/appointment'),
          meta: {
            tab: '预约管理'
          }
        },
        {
          path: '/mall/product/config',
          component: () => import('@/views/mall/product/config'),
          meta: {
            tab: '商城配置'
          }
        },
        {
          path: '/mall/product/order',
          component: () => import('@/views/mall/product/order'),
          meta: {
            tab: '订单管理'
          }
        },
        {
          path: '/mall/product/coupon/index',
          component: () => import('@/views/mall/product/coupon/index'),
          meta: {
            tab: '优惠券'
          }
        }
      ]
    },
    {
      path: '/redirect/redirect',
      component: () => import('@/views/redirect/redirect'),
      meta: {
        tab: '加载中...'
      }
    },
    {
      path: '/temp/index',
      component: () => import('@/views/temp/index'),
      meta: {
        tab: '信用卡申请'
      }
    },
    {
      path: '/temp/gzhTransit',
      component: () => import('@/views/temp/gzhTransit'),
      meta: {
        // 信用卡申请中转页面
        tab: '信用卡申请'
      }
    },
    {
      path: '/temp/creditCardIncrease',
      component: () => import('@/views/temp/creditCardIncrease'),
      meta: {
        tab: '信用卡增额申请'
      }
    },
    {
      path: '/bankCreditCard/page_1',
      component: () => import('@/views/bankCreditCard/page_1'),
      meta: {
        tab: '建行信用卡申请'
      }
    },
    {
      path: '/bankCreditCard/page_2',
      component: () => import('@/views/bankCreditCard/page_2'),
      meta: {
        tab: '建行信用卡申请'
      }
    }
  ]
}

const constantRoutes = getRoutes();

const router = new VueRouter({
  routes: constantRoutes
});

export default router
